﻿<%@ page language="java" import="java.util.*, com.onlinesys.beans.UserInfo, com.opensymphony.xwork2.ActionContext;" pageEncoding="UTF-8"%>
<%
		String path = request.getContextPath();
		String basePath = request.getScheme() + "://" + request.getServerName()
				+ ":" + request.getServerPort() + path + "/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>main</title>
<LINK href="./css/style.css" type=text/css rel=stylesheet>
<LINK href="./css/main.css" type=text/css rel=stylesheet>
<script src="./js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="./js/main.js" type="text/javascript"></script>
<script src="./js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="./js/jquery.validate.min.js" type="text/javascript"></script>
<script src="./js/validate.js" type="text/javascript"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #5CB7FE;
}
.STYLE1 {font-size: 12px}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
.STYLE5 {font-size: 12px; color: #FF0000; }
.STYLE6 {
	font-size: 16px;
	font-weight: bold;
}
-->
 </style>
</head>
<script language="javascript">
$(document).ready(function() {
    $("#area").keydown(function(event) {
        var keyCode = event.which;
        if (keyCode == 46 || keyCode == 8 || keyCode == 190 || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105) || keyCode == 110) {
            return true;
        } else { return false; }
    }).focus(function() {
        this.style.imeMode = 'disabled';
    });
    $("#quantity").keydown(function(event) {
        var keyCode = event.which;
        if (keyCode == 46 || keyCode == 8 || (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105) || keyCode == 110) {
            return true;
        } else { return false; }
    }).focus(function() {
        this.style.imeMode = 'disabled';
    });
    //if ($("#msg").css("display") == 'block') {
    //	$("#msg").delay(10000).fadeOut("slow");
    //}
});


 var popupStatus = 0;
 $(function(){
   var $place = function(selector){//目标居中,目标应为绝对定位
     var $t=( $(window).height()-$(selector).height())/2;
     var $l=( $(window).width()-$(selector).width())/2;    
     $(selector).css({"left":$l+"px","top":$t+"px"});
   }
   
   $("#close").click(function(){
     //仅在开启标志popupStatus为1的情况下去除     
     if(popupStatus==1){
      $("#screen").fadeOut("slow");
      $("#showdiv").fadeOut("slow");
      popupStatus = 0;
     }      
   });
   
   $("#move").mouseover(function(event){
    var _move=false;//移动标记
    var _x,_y;//鼠标离控件左上角的相对位置
    
    $("#move").mousedown(function(e){
     _move=true;     
     _x=e.pageX-parseInt($("#showdiv").css("left"));         
     _y=e.pageY-parseInt($("#showdiv").css("top"));          
    });
        
    $(document).mousemove(function(e){
     if(_move){
      var x=e.pageX - _x;//移动时根据鼠标位置计算控件左上角的绝对位置
      var y=e.pageY - _y;
      $("#showdiv").css({"top":y,"left":x});//控件新位置      
     }
    }).mouseup(function(){
     _move=false;         
    });     
  });
 });

 function loadPopup(){    
    //仅在开启标志popupStatus为0的情况下加载 
    if(popupStatus==0){
     $("#screen").css({
      "opacity": "0.5"
     });     
     $("#screen").fadeIn("slow");
     showDivCenter("#showdiv");
      $("body").css({"overflow":"hidden"});
     popupStatus= 1;    
    }
 } 
 
 function showDivCenter(div)
{
	  var wnd = $(window), doc = $(document);
	  var left = doc.scrollLeft();
	  var top = doc.scrollTop();
	 left += (wnd.width() - $(div).width())/2;
	  top += (wnd.height() - $(div).height())/2;
	   $(div).css("position","absolute");
	  $(div).css("top",top);
	  $(div).css("left",left);
	  $(div).fadeIn("slow");
}

function fn_editTicket(id, ticketNum, drawingNum, quantity) {
		$("#move").html("修改出库记录[" + ticketNum + "]");
		$("#id").val(id);
	    $("#newTicketNum").val(ticketNum);
		$("#newDrawingNum").val(drawingNum);
		$("#newQuantity").val(quantity);
        $(window).resize(function(){$place ($("showdiv"));}); //调整浏览器大小    
        loadPopup();
}

function fn_checkSmt() {
    ticketNum = $("#ticketNum").val();
	if (ticketNum!="" && ticketNum.length > 30) {
		alert("单号长度不能大于30个字符");
	}
}
</script> 

<body style="overflow-x:hidden">
<table width="100%" height="568" border="0" cellpadding="0"
	cellspacing="0" bordercolor="#D8EDFF">
	<!--DWLayoutTable-->
	<tr>
		<td height="8" colspan="4" valign="top"></td>
		<td width="834" valign="top"></td>
		<td width="5" valign="top"></td>
	</tr>
	<tr>
		<td height="5" colspan="3" align="right" valign="top"><img
			src="images/icon1.jpg" width="6" height="5" /></td>
		<td colspan="2" valign="top"><img src="images/icon2.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon3.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td width="7" height="523">&nbsp;</td>
		<td width="5" align="right" valign="top" background="images/icon5.jpg"><img
			src="images/icon5.jpg" width="5" height="5" /></td>
		<td colspan="2" valign="top" bgcolor="#D8EDFF">&nbsp;</td>
		<td valign="top" background="images/main_bg.png">
		
		<table width="100%" border="0" cellpadding="0" cellspacing="0"
			bgcolor="#D8EDFF">
			<!--DWLayoutTable-->
			<tr>
				<td height="30" colspan="3" valign="middle"><span class="STYLE1">&nbsp;[出库记录]</span></td>
				<td width="29">&nbsp;</td>
			</tr>
			<tr>
				<td height="59" colspan="3" align="center" valign="middle" class="STYLE6">产&nbsp;&nbsp; 品&nbsp;&nbsp; 出&nbsp; 库&nbsp;&nbsp; 表</td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td width="90" height="345">&nbsp;</td>
				<td width="90%" valign="top">
		<form name="searchform" id="searchform" method="post" action="outWarehouse.action" onSubmit="return check();">
			 <fieldset>
   				 <legend class="STYLE1"><img alt="查询" src="images/search.png"/> &nbsp;&nbsp;查 询</legend>
   				 <s:if test="msg != null"> 
   				 	<div id="msg">
   				 		<table>
   				 			<tr>
   				 				<td width="1%"><img src="images/error.gif"></td>
   				 				<td>&nbsp;&nbsp;<span id="msgText"><s:property value="msg"/></span></td>
   				 				<td width="1%"><img src="images/close.png" alt="关闭" style="cursor:pointer;" onclick="closeMsgBox()"/></td>
   				 			</tr>
   				 		</table>
   				 	</div>
					</s:if>
					<table>
						<tr>
						 <td width="40" align="right" valign="middle"></td>
						  <td width="75" align="right" valign="middle"><span class="STYLE1">单号：</span></td>
						  <td width="122" valign="middle"><input name="ticketNum" id="ticketNum" type="text" size="16" maxlength="20" style="width:80px; height:18px;" value="<s:property value="ticketNum"/>"></td>
						  <td width="120" align="right" valign="middle"><span class="STYLE1">图号：</span></td>
						  <td width="122" valign="middle"><input name="drawingNum" id="drawingNum" type="text" size="16" maxlength="20" style="width:80px; height:18px;" value="<s:property value="drawingNum"/>"></td>
						  <td width="120" align="right" valign="middle"><span class="STYLE1">厂家：</span></td>
						  <td width="122" valign="middle"><input name="vendor" id="vendor" type="text" size="16" maxlength="20" style="width:80px; height:18px;" value="<s:property value="vendor"/>"></td>
						 <!--   <td width="120" align="right" valign="middle"><span class="STYLE1">型号：</span></td>
						  <td width="122" valign="middle"><input name="modelSerialNum" type="text" size="16" maxlength="20" style="width:80px; height:18px;" value="<s:property value="modelSerialNum"/>"></td>
						  -->
						  <td width="120" align="right" valign="middle"><span class="STYLE1">面积：</span></td>
						  <td width="122" valign="middle"><input name="area" id="area" type="text" size="16" maxlength="20" style="width:80px; height:18px;" value="<s:property value="area"/>"></td>
						
					  	</tr>
						<tr>
						 <td width="40" align="right" valign="middle"></td>
						  <td align="right" valign="middle"><span class="STYLE1">数量：</span></td>
						  <td valign="middle"><input name="quantity" id="quantity" type="text" size="16" maxlength="20" style="width:80px; height:18px;" value="<s:property value="quantity"/>"></td>
						  <td align="right" valign="middle"><span class="STYLE1">起始日期：</span></td>
						  <td valign="middle"><!-- <input name="slogDate" id="sdate" for="sdate" type="text" onDblClick="setday(this,slogDate)" dataType="Date" format="ymd" size="16" maxlength="20" style="width:80px; height:18px;" onClick="setday(this,slogDate)" value="<s:property value="slogDate"/>"> -->
						  	<input name="slogDate" type="text" id="sdate" onclick="WdatePicker({skin:&#39;whyGreen&#39;,dateFmt:&#39;yyyy-MM-dd&#39;})" size="10" maxlength="10" style="width:80px; height:18px;" readonly="readonly" value="<s:property value="slogDate"/>"/>
						  </td>
						  <td align="right" valign="middle"><span class="STYLE1">结束日期：</span></td>
						  <td valign="middle"><!-- <input name="elogDate" id="edate" type="text" onDblClick="setday(this,elogDate)" dataType="Date" format="ymd" size="16" maxlength="20" style="width:80px; height:18px;" onClick="setday(this,elogDate)" value="<s:property value="elogDate"/>"> -->
						  <input name="elogDate" type="text" id="edate" onclick="WdatePicker({skin:&#39;whyGreen&#39;,dateFmt:&#39;yyyy-MM-dd&#39;})" size="10" maxlength="10" style="width:80px; height:18px;" readonly="readonly" value="<s:property value="elogDate"/>"/>
						  </td>
						  <td align="right" valign="middle"><span class="STYLE1"></span></td>
						  <td align="center" valign="middle"><input name="Submit2" type="submit" class="btn1_mouseout" onMouseOver="this.className='btn1_mouseover'" onMouseOut="this.className='btn1_mouseout'" value=" 查 询 "></td>
						  <td><input name="search" type="hidden" value="true"/></td>
					  	</tr>
				  </table>
		  	 </fieldset>
		  </form>
				<FORM name="form1" method="post">
				<table width="100%" border=0 cellpadding=0 cellspacing=1
					bgcolor=5cb7fe>
					<!--DWLayoutTable-->
					<tr>
						<td width="5%" height="25" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">序号 </span></td>
						<td width="15%" height="25" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">出库单号 </span></td>
				   		<td width="15%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">图号</span></td>
						<td width="20%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">厂家</span></td>
						<td width="10%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">面积 (m&sup2)</span></td>
				        <td width="10%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">数量</span></td>				        
				        <td width="15%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">出库时间</span></td>
						<%  UserInfo ui = (UserInfo)ActionContext.getContext().getSession().get("user"); 
							if (ui.getGroupRight() == 2){ %>
						<td width="10%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">操作</span></td>
						<% } %>
					</tr>
					<s:iterator value="pds" status="st">
					<tr>
					  <td height="25" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="#st.count + (currentPage - 1) * pageSize"/></span></td>
					  <td height="25" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="ticketNum"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="drawingNum"/></span></td>
						<!--  
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="modelSerialNum"/></span></td>
						-->
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="vendor"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="area"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="quantity"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:date name="logDate" format="yyyy-MM-dd HH:mm:ss" /></span></td>
					  <%  if (ui.getGroupRight() == 2){ %>
					  <td width="60" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><img src="images/settings.png"/> <a href="javascript:fn_editTicket(<s:property value="id"/>,'<s:property value="ticketNum"/>','<s:property value="drawingNum"/>', <s:property value="quantity"/>)" style="color: blue;">修改</a></span></td>
					  <%  } %>
				  </tr>
				  </s:iterator>
				  <tr>
				  	<td height="25" colspan="8" align="center" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="pageBar" escape="false"/></span></td>
				  </tr>
				</table>
				</FORM>
				</td>
				<td width="50">&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
</table>
		</td>
		<td valign="top" background="images/icon6.jpg"><img
			src="images/icon6.jpg" width="5" height="100" /></td>
	</tr>

	<tr>
		<td height="5"></td>
		<td valign="top"><img src="images/icon7.jpg" width="5" height="5" /></td>
		<td colspan="3" valign="top"><img src="images/icon8.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon9.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td height="2"></td>
		<td></td>
		<td width="1"></td>
		<td width="6"></td>
		<td></td>
		<td></td>
	</tr>
</table>
<div id="screen"><!--该DIV用于锁屏--></div>
<div id="showdiv" style="width:300">
	<form name="editTicketForm" id="editTicketForm" method="post" action="outWarehouse!modifyTicket.action">
	<table style="width:300" class="STYLE1">
		<tr>
			<td style="text-align:center;" colspan="2"><span id="move"></span></td>
			<td><img id="close" src="./images/close.png" style="cursor:pointer;"></td>
		</tr>
		<tr>
			<td align="right">出库单号：</td>
			<td style="text-align:left;">
			<input type="text" id="newTicketNum"size="16" maxlength="20" style="width:120px; height:18px;" name="newTicketNum">
			</td>
			<td></td>
		</tr> 
		<tr>
			<td align="right">图号：</td>
			<td style="text-align:left;">
			<input type="text" id="newDrawingNum" name="newDrawingNum" size="16" maxlength="20" style="width:120px; height:18px;">
			</td>
			<td></td>
		</tr> 
		<tr>
			<td align="right">数量：</td>
			<td style="text-align:left;">
			<input type="text" id="newQuantity" name="newQuantity" size="16" maxlength="20" style="width:120px; height:18px;">
			</td>
			<td><input type="hidden" id="id" name="id"/></td>
		</tr>
		<tr>
			<td colspan="3"><div style="text-align:center; margin-top:10px;"><input type="submit" id="changePassBt" class="btn1_mouseout" value="提 交"/></div></td>
		</tr>
    </table>
    </form>
</div>
</body>
</html>
